package com.sbox.album.model;

import java.io.File;

public class AlbumInfo {
	private String mPath = null;
	private String mName = null;
	
	private File mFile = null;
	private PictureInfo[] mPictures = null;
	
	
	public AlbumInfo(String path)	{
		mPath = path;		
		update();
	}
	
	public void update() {
		mFile = new File(mPath);
		mName = mFile.getName();
		
		mPictures = AlbumManager.listPictures(mPath);
	}
	
	public PictureInfo[] getPictures() {
		return mPictures;
	}
	
	public String getPath() {
		return mPath;
	}
	
	public String getName() {
		return mName;
	}
	
	public int getPictureCount() {
		if( mPictures == null )
			return 0;
		
		return mPictures.length;
	}
	
	public PictureInfo getPicture(int index) {
		if( index < 0 || index >= mPictures.length )
			return null;
		
		return mPictures[index];
	}
}
